package com.wms.controller;

import com.wms.entity.WStore;
import com.wms.mytool.Result;
import com.wms.service.WStoreService;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 仓库信息表(WStore)表控制层
 *
 * @author Li Xiaoyu
 * @since 2023-10-20 17:20:40
 */
@RestController
@RequestMapping("/wStore")
public class WStoreController {
    /**
     * 服务对象
     */
    @Resource
    private WStoreService wStoreService;

    /**
     * 查询所有
     * @return 实例对象
     */
    @GetMapping("/selectAll")
    public Result selectAll(){
        return this.wStoreService.selectAll();
    }

    /**
     * 新增仓库接口
     * @param wStore 仓库信息
     * @return 实例对象
     */
    @PostMapping("/addWStore")
    public Result addWStore(@RequestBody WStore wStore){
        return this.wStoreService.addWStore(wStore);
    }

    /**
     * 修改仓库接口
     * @param wStore 仓库信息
     * @return 实例对象
     */
    @PutMapping("/updateWStore")
    public Result updateWStore(@RequestBody WStore wStore){
        return this.wStoreService.updateById(wStore);
    }

    /**
     * 删除仓库接口
     * @param storeId 仓库id
     * @return 实例对象
     */
    @DeleteMapping("{storeId}")
    public Result deleteWStore(@PathVariable("storeId") Integer storeId){
        return this.wStoreService.deleteWStore(storeId);
    }

}

